<!DOCTYPE html>
<html lang="zh-CN">
@include('base.head')
<body>
@include('index.base')
@if(session('__Ajax_RedirectFunc_status') == true)
    <div>
        <div class="alert alert-success alert-dismissible fade in" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <h3>成功</h3>
            <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
            <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
        </div>
    </div>
@endif
@if(session('__Ajax_RedirectFunc_status') === false)
    <div >
        <div class="alert alert-danger alert-dismissible fade in" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <h3>失败</h3>
            <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
            <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
        </div>
    </div>
@endif
<div class="container-fluid">
    <div class="container">
        <div class="row">
            <div class="col-md-12 ">
            <br>
                <div class="col-md-7">
                    <form action="/nameSelect" method="post">
                        <div class="col-md-9">
                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                            <input type="text" class="form-control" name="goods_name" placeholder="商品名称">
                        </div>
                        <button type="submit" class="btn btn-primary">搜索</button>
                    </form>
                </div>
                <div class="col-md-5">
                    <form action="/classSelect" method="post">
                        <div class="col-md-9">
                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                            <select class="form-control" name="class_id">
                                @foreach($classData as $classData_v)
                                    <option value="{{$classData_v->goods_class_id}}">{{$classData_v->goods_class_name}}</option>
                                @endforeach
                            </select>
                        </div>
                        <button type="submit" class="btn btn-primary">搜索</button>
                    </form>
                </div>
                <br><br>
                <hr>
                <div class="row">
                    @foreach($goodsData as $data)
                        <div class="col-sm-6 col-md-3">
                            <div class="thumbnail">
                                <img src="/images/{{$data->goods_image}}" style="width: 100%;height: 240px">
                                <div class="caption" style="padding-bottom: 1px">
                                    <h4 style="color: red;margin-top: 0px">￥{{$data->goods_price}}<small class="pull-right" style="margin-top: 3px">{{$data->goods_buy_num}}人购买</small></h4>
                                    <p><a href="/goodsInfo/{{$data->goods_id}}" style="text-decoration: none">{{$data->goods_name}}</a></p>
                                    <p>{{$data->business_shop}} <a href="/goodsShop/{{$data->business_id}}" class="pull-right" style="text-decoration: none">进入店铺</a></p>
                                        {{--<a href="#" class="btn btn-primary btn-sm" role="button">Button</a> <a href="#" class="btn btn-default btn-sm" role="button">Button</a>--}}
                                </div>
                            </div>
                        </div>
                    @endforeach
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>